<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head th:replace="header::head"></head>
<script type="text/javascript">
    var maccms = {"path": "", "mid": "6", "url": "www.scdmfun.cn", "wapurl": "www.cdmfun.cn", "mob_status": "0"};
    var conchtpl = {
        "surl": "/search.html",
        "tipt": "网站公告",
        "tipc": "这里是双辞动漫新站<br><span class='hl-text-conch'>注意事项：</span>1.老站新老站账号不通用<br>老站网址：<span class='hl-text-conch'>dm.scdmfun.cn</span><br>2.如果登录后还是提示未登录请稍等一会再刷新即可<br>动漫闲聊群：<span class='hl-text-conch'>542266218</span>",
        "slink": "https://www.scdmfun.cn/",
        "short": "",
        "api": "0",
        "tok": "",
        "term": "long-term",
        "ver": "3.1"
    }
</script>
<script type="text/javascript" src="/template/conch/asset/js/set/formValidator.js"></script>
<script type="text/javascript" src="/static/js/jquery.imageupload.js"></script>
<title>观看记录 - 个人中心 - 双辞动漫-专注二次元动漫的小站</title>
<meta name="keywords" content="观看记录 - 个人中心">
<meta name="description" content="观看记录 - 个人中心">
<body id="conch-member">
<!--海螺影视主题  https://www.360mb.net/23977.html-->
<div th:replace="header::.conch-header"></div>
<div class="conch-header">
    <div class="conch-headwrap conch-hasone conch-hasconch hl-hide-sm">
        <div class="hl-mob-nav">
            <a href="javascript:MAC.GoBack()" class="hl-pull-left left"><i class="iconfont hl-icon-jiantouzuo"></i></a>
            <a href="javascript:;" id="btnClear" class="hl-pull-right right"><i
                    class="iconfont hl-icon-lajitong"></i></a>
            <span class="hl-mob-title hl-text-site hl-lc-1">观看记录</span>
        </div>
    </div>
</div>
<div id="conch-content" class="conch-content conch-member">
    <div class="conch-ctwrap">
        <div class="hl-ctwrap-item">
            <div class="container">
                <div class="hl-row-box clearfix">
                    <div class="row">
                        <div th:replace="ajax_info::#left"></div>
                        <div id="right" class="hl-right-content hl-col-xs-12 hl-col-sm-70w hl-col-lg-9">
                            <div class="hl-cont-right">
                                <div class="hl-rb-head hl-hidden-xs clearfix">
                                    <h2 class="hl-rb-title">观看记录</h2>
                                </div>
                                <div class="hl-tool-btns">
                                    <a name="selectAll" @click.prevent="selectAll()">全选</a>
                                    <a @click="selectOther">反选</a>
                                    <a @click="delselect">删除</a>
                                    <a @click="delAll()">清空</a>
                                </div>
                                <ul class="hl-data-list clearfix">
                                    <li class="hl-data-item" v-if="recordList.length>0" v-for="list in recordList">
                                        <input name="dellist" type="checkbox" :value="list.rcid" v-model="dellist" class="conch-input">
                                        <div class="hl-item-pic">
                                            <a class="hl-item-thumb hl-lazy"
                                               :href="'/play?ctid='+list.ctid+'&cpname='+cartoonMap[list.ctid].cpname+'&pname='+cartoonMap[list.ctid].pname"
                                               :title="cartoonMap[list.ctid].cname"
                                               :data-original="cartoonMap[list.ctid].cimage"
                                               :style="'background-image: url('+cartoonMap[list.ctid].cimage+')'">
                                                <div class="hl-pic-icon hl-hidden-xs"><i
                                                        class="iconfont hl-icon-bofang-fill"></i></div>
                                            </a>
                                        </div>
                                        <div class="hl-item-content">
                                            <div class="hl-item-title hl-text-site hl-lc-2"><a
                                                    :href="'/play?ctid='+list.ctid+'&cpname='+pmapMap[list.pid].cpname+'&pname='+pmapMap[list.pid].pname"
                                                    :title="cartoonMap[list.ctid].cname">{{cartoonMap[list.ctid].cname}}<span
                                                    class="hl-text-muted">[{{pmapMap[list.pid].cpname}}]</span></a>
                                            </div>
                                            <div class="hl-item-sub hl-text-muted">
                                                <p class="hl-lc-1">类型：{{csnameMap[list.ctid]}}</p>
                                                <p class="hl-lc-1">消耗：<span class="hl-text-conch">[0]</span>积分</p>
                                                <p class="hl-lc-1">时间：{{list.rcdate}}</p>
                                            </div>
                                        </div>
                                        <a class="hl-btn-del hl-btn-border" @click="del(list.rcid)"><i
                                                class="iconfont hl-icon-lajitong"></i><span
                                                class="hl-hidden-xs"> 删除</span></a>
                                    </li>
                                </ul>
                                <ul class="hl-page-wrap hl-text-center cleafix" v-if="recordList!=null&&recordList.length>0">
                                    <li class="hl-hide-sm"><a @click="query(1)" class="hl-disad"><i
                                            class="iconfont hl-icon-jiantoushou"></i></a></li>
                                    <li><a @click="query(prePage)" :class="prePage>0?'':'hl-disad'"><span class="hl-hide-sm"><i
                                            class="iconfont hl-icon-jiantouzuo"></i></span><span class="hl-hidden-xs">上一页</span></a>
                                    </li>
                                    <li class="hl-hidden-xs" v-if="curPage-1>2"><a
                                            @click="query(totalPage)">1</a></li>
                                    <li class="hl-hidden-xs hl-disad" v-if="curPage>4"><a
                                            class="hl-page-dot"
                                            href="javascript:;"><span>...</span></a></li>
                                    <li class="hl-hidden-xs" v-if="preprePage>0"><a @click="query(preprePage)">{{preprePage}}</a>
                                    </li>
                                    <li class="hl-hidden-xs" v-if="prePage>0"><a @click="query(prePage)">{{prePage}}</a></li>
                                    <li class="hl-hidden-xs"><a @click="query(curPage)" class="active">{{curPage}}</a></li>
                                    <li class="hl-hidden-xs" v-if="nextPage>0"><a @click="query(nextPage)">{{nextPage}}</a></li>
                                    <li class="hl-hidden-xs" v-if="nextnextPage>0"><a
                                            @click="query(nextnextPage)">{{nextnextPage}}</a></li>
                                    <li class="hl-page-tips hl-hide-sm"><a
                                            href="javascript:;">{{curPage}}&nbsp;/&nbsp;{{totalPage}}</a></li>
                                    <li class="hl-hidden-xs hl-disad" v-if="totalPage-curPage>3"><a
                                            class="hl-page-dot"
                                            href="javascript:;"><span>...</span></a></li>
                                    <li class="hl-hidden-xs" v-if="totalPage-curPage>2"><a
                                            @click="query(totalPage)">{{totalPage}}</a></li>
                                    <li><a @click="query(nextPage)" :class="nextPage>0?'':'hl-disad'"><span class="hl-hide-sm"><i
                                            class="iconfont hl-icon-jiantouyou"></i></span><span
                                            class="hl-hidden-xs">下一页</span></a></li>
                                    <li class="hl-hide-sm"><a @click="query(totalPage)"><i class="iconfont hl-icon-jiantouwei"></i></a>
                                    </li>
                                </ul>
                                <div class="hl-empty-wrap hl-text-center hl-col-xs-12" v-else>
                                    <i class="iconfont hl-icon-wushuju"></i><p>暂无数据</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--海螺影视主题  https://www.360mb.net/23977.html-->
<div th:replace="ajax_info::.conch-footer"></div>
<script type="text/javascript">
    $(".face").imageUpload({
        formAction: "/index.php/user/portrait.html",
        inputFileName: 'file',
        browseButtonValue: '<i class="iconfont hl-icon-xie"></i>',
        browseButtonClass: 'hl-face-upload',
        automaticUpload: true,
        hideDeleteButton: true,
        hover: true
    })
    $(".face").on("imageUpload.uploadFailed", function (ev, err) {
        alert(err);
    });
</script>
<script type="text/javascript">
    $(".hl-tui-btn").click(function () {
        $(".hl-tui-wrap").slideToggle("slow");
    });
</script>
<script type="text/javascript">
    let a = new Vue({
        el: "#conch-content",
        data: {
            recordList: [],
            cartoonMap: [],
            csnameMap: [],
            pmapMap: [],
            dellist: [],
            prePage: -1,
            preprePage: -1,
            curPage: -1,
            nextPage: -1,
            nextnextPage: -1,
            totalNum: -1,
            totalPage: -1,
            messsage: {
                ucount: '',  //账号
                nickname: '',  //昵称
                uscore: '',   //积分
                password: '',  //密码
                uimage: '',    //用户头像
                email: '',    //邮箱
                qq: '',       //QQ
                registerdate: '',  //注册时间
                lastlogineddate: '',  //最后登录时间
                curlogindate: '',    //当前登录时间
                ugroup: '',         //会员类型
                deadline: '',       //会员期限
                loginednum: ''      //登录次数
            }
        },
        methods: {
            selectuser() {
                let url = "user/selectuser";
                axios.post(url).then(res => {
                    var data = res.data;
                    if (data.code == 1) {
                        this.messsage = data.data;
                    }
                })
            },
            getPlays() {
                if (this.messsage.uid == null || this.messsage.uid <= 0) {
                    return;
                }
                var url = "getPlays.do";
                var params = new URLSearchParams();
                params.append("uid", this.messsage.uid);
                axios.post(url, params).then(res => {
                    var data = res.data;
                    if (data.code == 1) {
                        this.prePage = data.data["prePage"];
                        this.preprePage = data.data["preprePage"];
                        this.curPage = data.data["curPage"];
                        this.nextPage = data.data["nextPage"];
                        this.nextnextPage = data.data["nextnextPage"];
                        this.totalNum = data.data["totalNum"];
                        this.totalPage = data.data["totalPage"];
                        this.recordList = data.data["dataList"];
                        this.cartoonMap = data.data["cartoonMap"];
                        this.csnameMap = data.data["csnameMap"];
                        this.pmapMap = data.data["pmapMap"];
                    } else {
                        alert(data.msg);
                    }
                })
            },
            query(page){
                var url = "getPlays.do";
                var params = new URLSearchParams();
                params.append("uid", this.messsage.uid);
                params.append("page",page);
                axios.post(url, params).then(res => {
                    var data = res.data;
                    if (data.code == 1) {
                        this.prePage = data.data["prePage"];
                        this.preprePage = data.data["preprePage"];
                        this.curPage = data.data["curPage"];
                        this.nextPage = data.data["nextPage"];
                        this.nextnextPage = data.data["nextnextPage"];
                        this.totalNum = data.data["totalNum"];
                        this.totalPage = data.data["totalPage"];
                        this.recordList = data.data["dataList"];
                        this.cartoonMap = data.data["cartoonMap"];
                        this.csnameMap = data.data["csnameMap"];
                        this.pmapMap = data.data["pmapMap"];
                    }
                })
            },
            del(rcid) {
                var url = "deletePlays.do";
                var params = new URLSearchParams();
                params.append("rcid", rcid);
                axios.post(url, params).then(res => {
                    var data = res.data;
                    if (data.code == 1) {
                        this.getPlays();
                    }
                    alert(data.msg);
                })
            },
            delAll() {
                var url = 'deleteAllPlays.do';
                var params = new URLSearchParams();
                params.append("uid",this.messsage.uid);
                axios.post(url, params).then(res => {
                    var data = res.data;
                    if (data.code == 1) {
                        this.recordList = [];
                        this.cartoonMap = [];
                        this.csnameMap = [];
                    }
                    alert(data.msg);
                })
            },
            selectAll(){
                this.dellist=[];
                for (var list in this.recordList) {
                    this.dellist.push(this.recordList[list].rcid);
                }
            },
            selectOther(){
                var temp=[];
                for (var list in this.recordList) {
                    if(!this.dellist.includes(this.recordList[list].rcid)){
                        temp.push(this.recordList[list].rcid);
                    }
                }
                this.dellist=temp;
            },
            delselect(){
                var url = 'deleteSelectedPlays.do';
                var params = new URLSearchParams();
                var str=JSON.stringify(this.dellist);
                params.append("str",str);
                axios.post(url, params).then(res => {
                    var data = res.data;
                    if (data.code == 1) {
                        this.getPlays();
                    }
                    alert(data.msg);
                })
            },
            handleFile(){
                let files = document.getElementById('file').files;
                if(!files){
                    return;
                }
                this.file=files[0];
                this.uploadFile();
            },
            uploadFile(){
                let formData = new FormData();
                formData.append("file",this.file);
                formData.append("uid",this.messsage.uid);
                axios({
                    url:'/uploadFile',
                    method:'post',
                    data:formData
                }).then(res=>{
                    if(res.data.code > 0 ){
                        this.selectuser();
                        login.$data.user={};
                    }
                })
            }
        },
        beforeMount() {
            window.selectuser = this.selectuser();
        },
        watch: {
            messsage(newobj, oldobj) {
                this.getPlays();
            }
        }
    })
</script>
</body>
</html>